/**
 * 	 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *   @author Colin Redmond
 *   Copyright (C) 2011 Colin Redmond
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.cred.industries.platform.business.objects;

import java.util.HashMap;
import java.util.Map;

import org.joda.time.DateTime;

/**
 * All business rules relating to the metrics
 * and all the data needed to modify the metrics in the DB
 * 
 * use the MetricsBOBuilder to build this object for ease of use
 */
public class MetricsBO {
	
	private int mMetricInstanceId = 0;
	/**
	 * type of the metric
	 */
	private String mMetricType = "";
	/**
	 * customer making the metric
	 */
	private int mSourceCustId = -1;
	/**
	 * target of customer making the metric
	 */
	private int mTargetCustId = -1;
	/**
	 * time the metric happened
	 */
	private DateTime mTime;
	
	/**
	 * any integers describing the metric
	 */
	private Map<String, Integer> mIntMetrics = new HashMap<>();
	/**
	 * any floats describing the metric
	 */
	private Map<String, Float> mFloatMetrics = new HashMap<>();
	private Map<String, String> mStringMetrics = new HashMap<>();
	
	public int getMetricInstanceId() { return mMetricInstanceId; }
	public void setMetricInstanceId(int val) { mMetricInstanceId = val; }
	public String getMetricType() { return mMetricType; }
	public int getSourceCustId() { return mSourceCustId; }
	public int getTargetCustId() { return mTargetCustId; }
	public DateTime getTime() {	return mTime; }
	public Map<String, Integer> getIntMetrics() { return mIntMetrics; }
	public Map<String, Float> getFloatMetrics() { return mFloatMetrics; }
	public Map<String, String> getStringMetrics() {	return mStringMetrics; }


	/**
	 * constuctor
	 * @param metricType type of the metric
	 * @param sourceCustId customer making the metric
	 * @param targetCustId target of customer making the metric
	 * @param time time the metric happened
	 * @param intMetrics any integers describing the metric
	 * @param floatMetrics any floats describing the metric
	 * @param stringMetrics any strings describing the metric
	 */
	public MetricsBO(String metricType, int sourceCustId, int targetCustId, DateTime time
			, Map<String, Integer> intMetrics, Map<String, Float> floatMetrics, Map<String, String> stringMetrics) {
		
		this.mMetricType = metricType;
		this.mSourceCustId =sourceCustId;
		this.mTargetCustId = targetCustId;
		this.mTime = time;
		this.mIntMetrics = intMetrics;
		this.mFloatMetrics = floatMetrics;
		this.mStringMetrics = stringMetrics;
	}
}
